import { getLogs } from '@/api/log'

const state = {
  logObject: {},
  logLIst: []
}

const mutations = {
  SET_LOGLIST: (state, data) => {
    state.logObject = data
    state.logList = data.list
  }
}

const actions = {
  getLogs({ commit }, logInfo) {
    return new Promise((resolve, reject) => {
      getLogs().then(response => {
        // const { data } = response
        // commit('SET_LOGLIST', data)
        resolve(response)
      }).catch(error => {
        reject(error)
      })
    })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
